<html>
<body>

<?php

$path = $_GET["path"];
if ($path == "") $path = "/";
if (is_dir($path))	//only directory link
//if (is_dir($path) || is_file($path))	//directory and file link
{
	$dir_full = $path . $dir;
	$break_dir_full = explode("/", $dir_full);
	for ($i=0; $i<(count($break_dir_full)-2); $i++)
	{
		$new_dir_full = $new_dir_full . $break_dir_full[$i] . "/";
	}
	if ($new_dir_full == "") $new_dir_full = "/";
	?>
	<a href="index.php?path=<?php echo $new_dir_full; ?>"><?php echo ".." ?></a><br/>
	<?php
	$list = scandir($path);
	foreach ($list as $dir)
	{
		$dir_full = $path . $dir;
		if (is_dir($dir_full) && $dir!=".." && $dir!=".")
		{
			$dir_full = $dir_full . "/";
			?>
			<a href="index.php?path=<?php echo $dir_full; ?>"><?php echo $dir ?></a><br/>
			<?php
		}
		/*if (is_file($dir_full))
		{
			?>
			<a href="index.php?path=<?php echo $dir_full; ?>"><?php echo $dir ?></a><br/>
			<?php
		}*/
	}
	echo "<pre>";
	$command = "getfacl " . $path;
	$output = system($command);
	echo "$output";
}

?>

<body>
<html>
